package cn.net.isir.utils;

import cn.net.isir.common.TransferAESUtils;
import com.alibaba.fastjson.JSONObject;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

/**
 * @author zhaoxiang
 * @date 2019/4/8 16:59
 */
public class AesDecode {
    public static String AesDecode(String value){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("key", value);
        String base64 = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8));
        String aesString = TransferAESUtils.aesEncrypt(base64);
        return aesString;
    }

    public static void main(String[] args) {
        String str = AesDecode.AesDecode("abcdefg");
        System.out.println(str);
    }
}
